package com.cnap.multiclouldmgmt.model.alarm;

import cn.hutool.core.text.CharSequenceUtil;


/**
 * 通知配置-通知方式
 *
 * @author xc
 **/
public enum NoticeTypeEnum implements ValidInterface {
    MESSAGE("短信通知"),
    MAIL("邮件通知"),
    MESSAGE_MAIL("邮件+短信通知");
    private final String type;

    NoticeTypeEnum(String type) {
        this.type = type;
    }

    /**
     * get
     *
     * @return Type
     */
    public String getType() {
        return type;
    }


    @Override
    public boolean isValid(String value) {
        if (CharSequenceUtil.isEmpty(value)) {
            return false;
        }
        IndicatorEnum[] enums = IndicatorEnum.values();
        for (IndicatorEnum indicatorEnum : enums) {
            if (indicatorEnum.getName().equals(value)) {
                return true;
            }
        }
        return false;
    }
}
